<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>轮播列表</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <a class="btn" href="{:U('property_add')}">新 增</a>
            <button class="btn sc"  target-form="ids">删 除</button>
        </div>

        <!-- 高级搜索 -->
        <div>
        <form action="{:U(Manage/property_consultant)}" method="post">
        <table>
            <tr>
                <td>&nbsp&nbsp&nbsp</td>
                <td>
                    名称搜索:&nbsp&nbsp
                </td>
                <td>
                    <input type="text" name="name" value="{$msg.name}" style="border:1px solid #ccc;border-radius:5px;height:26px;line-height:26px;">
                </td>
                <td>&nbsp
                    <input type="submit" value="搜索" class="btn">
                </td>
            </tr>
        </table>
        </form>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
    <table class="">
    <thead>
        <tr>
        <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
        <th class="">图片</th>
        <th class="">排序</th>
        <th class="">名称</th>
        <th class="">手机号码</th>
        <th class="">操作</th>
        </tr>
    </thead>
    <tbody>
        <notempty name="list">
        <volist name="list" id="vo">
        <tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
            <td><img src="{$vo['img']}" width="30" height="30"></td>
            <td>{$vo.sort}</td>
            <td>{$vo['name']}</td>
            <td>{$vo.mobile}</td>
            <td>
                <a href="{:U('Manage/property_add?method=resumeUser&id='.$vo['id'])}" class="">编辑</a>
                <a onclick="ss({$vo.id})"  style="cursor: pointer;">删除</a>
                </td>
        </tr>
        </volist>
        <else/>
        <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
        </notempty>
    </tbody>
    </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script src="__JS__/laydate/laydate.js"></script>
    <script type="text/javascript">
    laydate.render({
      elem: '#test1' //指定元素
      ,type: 'datetime'
    });
    laydate.render({
      elem: '#test2' //指定元素
      ,type: 'datetime'
    });
    //搜索功能
    $("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
        window.location.href = url;
    });
    //回车搜索
    $(".search-input").keyup(function(e){
        if(e.keyCode === 13){
            $("#search").click();
            return false;
        }
    });
//多选删除
    $('.sc').click(function(){
        var c='';
        $('.ids').each(function(k){
            if($(this).prop('checked')==true){
                 c+=','+$(this).val();
            }
        })
      
      if(c.substr(0,1)==','){
        c=c.substr(1);
      }
      if(confirm('确定删除吗？？？')){
          $.ajax({
            url:"{:U('Manage/property_del')}",
            data:{id:c},
            type:'POST',
            dataType:'json',
            success:function(data){
                alert(data.info);
              // window.localtion.reload();
              location.replace(location.href);
            }
          })
        }
    })
    //删除
    function ss(id){
    var id=id;
    if(confirm('确定删除吗？？？')){
        $.ajax({
            url:"{:U('Manage/property_del')}",
            data:{'id':id},
            dataType:'json',
            type:'post',
            success:function(data){
                alert(data.info);
                window.location.reload();
            }
        })
    }
    }
    //导航高亮
    highlight_subnav('{:U('User/index')}');
    </script>
</block>




